<template>
  <!-- 将组件的内部配置显示出来 -->
  <div class="form-design-render">
    <component ref="form" :is="config.name" :mode="mode" v-model="formDesignRenderValue" v-bind="config.props"/>
  </div>
</template>
<script>

import components from './form-config/component-export.js'

export default {
  name: "FormDesignRender",
  components: components,
  props:{
    mode:{
      type: String,
      default: 'DESIGN'
    },
    value: {
      default: undefined
    },
    config:{
      type: Object,
      default: ()=>{
        return {}
      }
    }
  },
  computed: {
    formDesignRenderValue: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit("input", val);
      }
    }
  },
  data() {
    return {}
  },
  methods: {
    validate(call){
      this.$refs.form.validate(call)
    }
  }
}
</script>

<style lang="less" scoped>

</style>
